package study;

import org.junit.Test;

public class Main {

    @Test
    public void test1(){
        int[][] a = new int[][]{
                {1, 1, 1,},
                {1, 1, 2,},
                {1, 1, 3,},
        };

        System.out.println(a[0][2]);
        System.out.println(a[1][2]);
        System.out.println(a[2][2]);
    }


    @Test
    public void testStrategy(){
        Player taro = new Player("Taro", new WinningStrategy(314));
        Player hana = new Player("Hana", new ProbStrategy(15));

        for(int i = 0; i < 10000; i++){
            Hand nextHand1 = taro.nextHand();
            Hand nextHand2 = hana.nextHand();

            if(nextHand1.isStrongThan(nextHand2)){
                System.out.println("Winner:" + taro);
                taro.win();
                hana.lose();
            } else if(nextHand1.isWeakThan(nextHand2)){
                System.out.println("Winner:" + hana);
                taro.lose();
                hana.win();
            } else{
                System.out.println("Even...");
                taro.even();
                hana.even();
            }
        }

        System.out.println("Total result:");
        System.out.println(taro);
        System.out.println(hana);
    }
}
